package ai.esc.speedy.common.valueobject;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * LIst分页
 *
 * @author 周广明
 * @version v1 12/19/19 5:07 PM
 */
@Getter
@ToString
@AllArgsConstructor
public class ListPage {
    private final int offset;
    private final int limit;
}

// 使用案例

//@QueryHandler
//public ListCargoSummaryResult handle(ListCargoSummariesQuery listCargoSummariesQuery) {
//    logger.info("Handling {}", listCargoSummariesQuery);
//
//    Query jpaQuery = entityManager.createNamedQuery("CardSummary.findAll",
//            CargoSummary.class);
//    jpaQuery.setFirstResult(listCargoSummariesQuery.getOffset());
//    jpaQuery.setMaxResults(listCargoSummariesQuery.getLimit());
//    ListCargoSummaryResult result = new ListCargoSummaryResult(jpaQuery.getResultList());
//
//    return result;
//}
